doctype html
block begin
html(lang='en')
  head
    - var product = me.getProduct()
    - var productShort = product == 'codecombat' ? 'coco' : 'ozar'
    - var productCap = product == 'codecombat' ? 'CodeCombat' : 'Ozaria'
    meta(charset='utf-8')
    meta(name='viewport', content="width=device-width,initial-scale=1.0,viewport-fit=cover", data-vue-meta="true", data-vmid="viewport")
    meta(http-equiv='Accept-CH', content='Viewport-Width')
    title(data-i18n=`new_home.title_${productShort}`)
    meta(name="keywords", data-i18n=`[content]new_home.meta_keywords_${productShort}`)
    meta(name="description", data-i18n=`[content]new_home.meta_description_${productShort}`)
    if product == 'codecombat'
      meta(property='og:description', data-i18n="[content]new_home.meta_description_coco")
      meta(property='og:url', data-i18n="[content]new_home.meta_og_url")
    else
      meta(property='og:title', content='Ozaria - Computer science that captivates')
      meta(property='og:url', content='https://www.ozaria.com')
    meta(property='og:type', content='game')
    if product == 'codecombat'
      meta(property='og:image', content='https://codecombat.com/images/pages/home/play_img.png')
      meta(property='og:image:alt', content='CodeCombat')
    else
      meta(property='og:image', content='https://www.ozaria.com/images/pages/home/play_img.png')
    meta(property='og:site_name', content=productCap)
    meta(name='twitter:card', content='summary')
    if product == 'codecombat'
      meta(name='twitter:title', content='CodeCombat: Learn to Code by Playing a Game')
      meta(name='twitter:url', content='https://codecombat.com')
    else
      meta(name='twitter:title', content='Ozaria - Computer science that captivates')
      meta(name='twitter:url', content='https://www.ozaria.com')
    meta(name='twitter:site', content=productCap)
    if product == 'codecombat'
      meta(name='twitter:image:src', content='http://codecombat.com/images/pages/base/logo_square_250.png')
      meta(name='twitter:description', content='Learn programming with a multiplayer live coding strategy game for beginners. Learn Python or JavaScript as you defeat ogres, solve mazes, and level up. Open source HTML5 game!')
    else
      meta(name='twitter:image:src', content='https://www.ozaria.com/images/pages/base/logo_square_250_oz.png')
      meta(name='twitter:description', content='Ozaria is a computer science program, an adventure game, and a fantasy story where students master the lost magic of coding to save their world.')
    meta(name="p:domain_verify", content="f5afcb2c36bb8b1cbd70c44b65e5ec75")
    if product == 'codecombat'
      meta(name='fb:app_id', content='148832601965463')
    - var suffix = product == 'codecombat' ? '' : '?v=2020-11-15'
    link(rel="apple-touch-icon" sizes="180x180" href=`/images/favicon/favicon-${productShort}/apple-touch-icon.png${suffix}`)
    link(rel="icon" type="image/png" sizes="32x32" href=`/images/favicon/favicon-${productShort}/favicon-32x32.png${suffix}`)
    link(rel="icon" type="image/png" sizes="16x16" href=`/images/favicon/favicon-${productShort}/favicon-16x16.png${suffix}`)
    link(rel="mask-icon" href=`/images/favicon/favicon-${productShort}/safari-pinned-tab.svg${suffix}` color="#5bbad5")
    link(rel="shortcut icon" href=`/images/favicon/favicon-${productShort}/favicon.ico${suffix}`)
    - var color = product == 'codecombat'? '#da532c' : '#00a300'
    meta(name="msapplication-TileColor" content=color)
    meta(name="msapplication-config" content=`/images/favicon/favicon-${productShort}/browserconfig.xml${suffix}`)
    meta(name="facebook-domain-verification" content="xbahpe1at906kptbtd1g1w19ktlyru")
    if product != 'codecombat'
      meta(name="theme-color" content="#29575a")
    link(rel='manifest', href=`/images/favicon/favicon-${productShort}/manifest.json`)
    link(rel='stylesheet', href='/' + shaTag + '/stylesheets/app.css')
    script.
      var product = "#{me.getProduct()}"
    script.
      window.javascriptsPath = "/#{shaTag}/javascripts/";
    if chunkPaths[viewName]
      script(src=chunkPaths[viewName], defer='')
    script(src='/' + shaTag + '/javascripts/app.js', defer='', async='', data-ace-base='/javascripts/ace') // This data tag needs to be on SOME script with a src for Ace to work
    script(src='/user-data?sha=' + shaTag)
    script.
      window.document.cookie = "shaTagVal=#{shaTag};path=/;"
    if me.useGoogleAnalytics()
      // Google Analytics
      script.
        (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
        })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
        var gaKey = product == 'codecombat' ? 'UA-39724129-1' : 'UA-146501339-1'
        ga('create', gaKey, 'auto');

      script.
        if(product == 'codecombat') {
          (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
          new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
          j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
          'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
          })(window,document,'script','dataLayer','GTM-M2SGNTZ');
        }

      if me.getProduct() == 'codecombat'
        script(src="https://www.googletagmanager.com/gtag/js?id=G-CLTH4TL5L8" async)
      else
        // Global site tag (gtag.js) - Google Ads: 811324643
        script(src="https://www.googletagmanager.com/gtag/js?id=AW-811324643" async)
      script.
        window.dataLayer = window.dataLayer || [];
        function gtag() {
          dataLayer.push(arguments);
        }
        gtag('js', new Date());

        if(product == 'codecombat') {
          gtag('config', 'G-CLTH4TL5L8');
          window.gtag4Installed = true;
        } else {
          gtag('config', 'AW-811324643');
        }

      script(id="analytics-fbq").
        !function (f, b, e, v, n, t, s) {
          if (f.fbq) return;
          n = f.fbq = function () {
            n.callMethod ?
                    n.callMethod.apply(n, arguments) : n.queue.push(arguments)
          };
          if (!f._fbq) f._fbq = n;
          n.push = n;
          n.loaded = !0;
          n.version = '2.0';
          n.queue = [];
          t = b.createElement(e);
          t.async = !0;
          t.src = v;
          s = b.getElementsByTagName(e)[0];
          s.parentNode.insertBefore(t, s)
        }(window, document, 'script',
                'https://connect.facebook.net/en_US/fbevents.js');

        // Moved to dynamic tracker code to only apply to relevant user types
        //fbq('init', '514962702046652')
        //fbq('track', 'PageView')
    else
      // Baidu Analytics
      script.
        var bdKey = product == 'codecombat' ? 'ffc38c02cf8f484ab8f785b58dfa8b6e' : 'fd876f45e00409837a7a2619b2ce1709'
        var _hmt = _hmt || [];
        (function () {
          var hm = document.createElement("script");
          hm.src = "https://hm.baidu.com/hm.js?#{bdKey}";
          var s = document.getElementsByTagName("script")[0];
          s.parentNode.insertBefore(hm, s);
        })();

    // Datadog logging
    if me.getProduct() != 'codecombat' && me.useDataDog()
      script(src="https://www.datadoghq-browser-agent.com/datadog-logs-us.js")
      script.
        DD_LOGS.init({
          clientToken: 'puba9a669c3117915d99f1f47970d1f49ff',
          forwardErrorsToLogs: true
        });
              

    // Webpack-inserted CSS:
    //- (will be inserted at runtime)

    block setup
    block script-start
      script.
        //- This runs for pages without specific static templates
        //- Those pages with static templates run this themselves (in mock.static.pug),
        //-   after setting window.alreadyLoadedView
        function onLoad() {
          try {
              // IE10 warning
              var htmlElement = document.querySelector("html");
              if (htmlElement) {
                  if ($.browser.msie && $.browser.edge != true) {
                    if ((window.location.pathname || "").indexOf("web-dev-level") < 0) {
                      alert("CodeCombat does not support Internet Explorer, but runs on all other major browsers.");
                      }
                  }
              }
              // IE8 can't handle this
              FastClick.attach(document.body);
          } catch (error) { }
        }
  body.clearfix(onload='onLoad();')
    #fb-root
    block content
    #modal-wrapper.modal-content.hide
